package ac.zlf.springmybatis.core.exception;

public class WebException extends RuntimeException {
    private static final long serialVersionUID = 5235345858137787048L;
    private int key = 0;
    private String message;

    public WebException(String key) {
        super(key);
    }

    public WebException(int key, String message) {
        super(String.format("Request Error with code:%d, description:%s", new Object[]{Integer.valueOf(key), message}));
        this.key = key;
        this.message = message;
    }

    public WebException(String key, Throwable cause) {
        super(key, cause);
    }

    public WebException(Throwable cause) {
        super(cause);
    }

    public int getKey() {
        return this.key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
